<table width="560" border="0" cellspacing="0" cellpadding="0" style="border:1px solid #333">
  <tr>
    <td colspan="6" class="tieude" align="center">GIỎ HÀNG CỦA QUÝ KHÁCH</td>
  </tr>
  <tr bgcolor="#00FFFF" align="center" height="30" style="font-weight:bold">
    <td width="50" style="border-right:1px solid #666">STT</td>
    <td width="160" style="border-right:1px solid #666">Sản phẩm</td>
    <td width="60" style="border-right:1px solid #666">Số lượng</td>
    <td width="95" style="border-right:1px solid #666">Giá</td>
    <td width="95" style="border-right:1px solid #666">Tổng</td>
            
  </tr>
  <?php
  	$user=$_SESSION["user"];	
  	$sql="select giohang.*,sanpham.* from giohang,sanpham where giohang.id=sanpham.id AND giohang.user='$user' AND giohang.tinhtrang='themgiohang'";
	$kq=mysql_query($sql);
	$i=0;
	$tien=0;
	while($r=mysql_fetch_array($kq))
	{
		$id=$r["id"];
		$tensp=$r["tensp"];$soluong=$r["soluong"];
		$gia=$r["gia"]; $gia2=number_format($gia,0,'','.');
		$tong=$gia*$soluong; $tong2=number_format($tong,0,'','.');
		$tongtien=$tongtien+$tong;$tongtien2=number_format($tongtien,0,'','.');		
		$i++;
?>			
		<tr align="center" height="30" >
            <td width="50" style="border-right:1px solid #666; border-bottom:1px solid #666"><?php echo $i; ?></td>
            <td width="110" style="border-right:1px solid #666; border-bottom:1px solid #666"><?php echo $tensp; ?></td>
            <td width="60" style="border-right:1px solid #666; border-bottom:1px solid #666">
            <?php echo "$soluong"; ?>
            </td>
            <td width="95" style="border-right:1px solid #666; border-bottom:1px solid #666""><?php echo $gia2; ?> VND</td>
            <td width="95" style="border-right:1px solid #666; border-bottom:1px solid #666"><?php echo $tong2; ?> VND</td>
     	</tr>			
<?php			
	
	}
  ?>  
  <tr>
  	<td height="30" colspan="6" align="right" style="padding-right:5px; padding-bottom:5px; color:#F00">Tổng số tiền phải thanh toán: <?php echo "$tongtien2"; ?> VND</td>
  </tr>     
</table>
<?php
	$sql_user="select * from thanhvien where user='$user'";
	$kq_user=mysql_query($sql_user);
	while($r_user=mysql_fetch_array($kq_user))
	{
		$diachi=$r_user["diachi"];$email=$r_user["email"];
		$dienthoai=$r_user["dienthoai"];$hoten=$r_user["hoten"];
	}
?>
<table width="560" border="0" cellspacing="0" cellpadding="0" style="padding-top:10px; border:1px solid #333">
  <tr>
    <td colspan="6" class="tieude" align="center">THÔNG TIN LIÊN HỆ</td>
  </tr>
  <tr>
    <td height="30"><div style="padding-left:70px">Họ và tên: </div></td>
    <td width="350"><input name="hoten" type="text" size="35" maxlength="50" value="<?php echo $hoten;?>"> <font color="#FF0000">*</font></td>
  </tr>
  <tr>
    <td height="30"><div style="padding-left:70px">Địa chỉ:</div></td>
    <td><input name="diachi" type="text" size="35" maxlength="50" value="<?php echo $diachi;?>"> <font color="#FF0000"> *</font> </td>
  </tr>
  <tr>
    <td height="30"><div style="padding-left:70px">Email:</div> </td>
    <td><input name="email" type="text" size="35" maxlength="50" value="<?php echo $email;?>"> <font color="#FF0000"> *</font></td>
  </tr>
  <tr>
    <td height="30"><div style="padding-left:70px">Số điện thoại:</div></td>
    <td><input name="dt" type="text" size="35" maxlength="50" value="<?php echo $dienthoai;?>"> <font color="#FF0000"> *</font></td>
  </tr>
  <tr>
    <td height="30"><div style="padding-left:70px">Fax:</div></td>
    <td><input name="fax" type="text" size="35" maxlength="50"></td>
  </tr>
  <tr>
    <td height="30"><div style="padding-left:70px">Công ty:</div></td>
    <td><input name="cty" type="text" size="35" maxlength="50" value="<?php echo $cty;?>"></td>
  </tr>
  <tr>
    <td><div style="padding-left:70px">Nhập mã an toàn: </div></td>
    <td height="50"><div style="padding-left:20px; background-color:#CCC; width:100px; height:30">
      <?php include "include/antispam.php"; ?>
    </div>
      <input type="text" name="anti" size="35" maxlength="50" /> <font color="#FF0000">*</font></td>
  </tr>
  <tr>
    <td colspan="2" bgcolor="#0000FF" align="center" height="35"><input type="submit" value="Gửi" class="button" onmouseover="style.background='url(images/button-2.gif)'" onmouseout="style.background='url(images/button.gif)'" >
      <input type="reset" value="Nhập lại" class="button" onmouseover="style.background='url(images/button-2.gif)'" onmouseout="style.background='url(images/button.gif)'" >
      <input type="hidden" name="act"></td>
  </tr>
</table>
